package.json
"dependencies": {
"testarmada-midway": "^1.0.1"
}
npm install
Run npm install
command to install mock related dependencies.
resources/endpoints.js
and create ./resources/mocked-data
directory to store the mock data.require('./endpoints');
require('midway').start({
host: "localhost",
mockedDirectory: "./resources/mocked-data",
port: 8000,
project: 'HelloMidway'
});
resources/run-mock-server-console.js
require('./endpoints');
require('midway').start({
host: "localhost",
mockedDirectory: "./resources/mocked-data",
port: 8000,
project: 'HelloMidway'
});
Please note that you will need to replace HelloMidway
for key project
field with your project name(without dashes).
package.json
"scripts": {
"lint": "eslint . --ext .js",
"start-server": "node ./resources/run-mock-server-console.js"
},
npm run start-server